<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set parameters for a stream/wrapper/context</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.stream-context-set-option.html">« stream_context_set_option</a></li>
      <li style="float: right;"><a href="function.stream-copy-to-stream.html">stream_copy_to_stream »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.stream.html">Stream 函数</a></li>
    <li>Set parameters for a stream/wrapper/context</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.stream-context-set-params" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">stream_context_set_params</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">stream_context_set_params</span> &mdash; <span class="dc-title">Set parameters for a stream/wrapper/context</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.stream-context-set-params-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>stream_context_set_params</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$context</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$params</code></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Sets parameters on the specified context.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.stream-context-set-params-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">context</code></dt>

     <dd>

      <p class="para">
       The stream or context to apply the parameters too.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">params</code></dt>

     <dd>

      <p class="para">
       An associative array of parameters to be set in the following format:
       <code class="literal">$params[&#039;paramname&#039;] = &quot;paramvalue&quot;;</code>.
      </p>
      <table class="doctable table">
       <caption><strong>Supported parameters</strong></caption>
       
        <thead>
         <tr>
          <th>Parameter</th>
          <th>Purpose</th>
         </tr>

        </thead>

        <tbody class="tbody">
         <tr>
          <td>
           <code class="literal">notification</code>
          </td>
          <td>
           Name of user-defined callback function to be called whenever a stream triggers a notification.
           Only supported for <a href="wrappers.http.html" class="link">http://</a> and
           <a href="wrappers.ftp.html" class="link">ftp://</a> stream wrappers.
          </td>
         </tr>

         <tr>
          <td>
           <code class="literal">options</code>
          </td>
          <td>
           Array of options as in <a href="context.html" class="link">context options and parameters</a>.
          </td>
         </tr>

        </tbody>
       
      </table>

     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.stream-context-set-params-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>， 或者在失败时返回 <strong><code>false</code></strong>。
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.stream-context-set-params-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="function.stream-notification-callback.html" class="function" rel="rdfs-seeAlso">stream_notification_callback()</a> - A callback function for the notification context parameter</span></li>
  </ul>
 </div>


</div></div></div></body></html>